import {getCates} from "../../request/api"
const state={
    cateList:[]
} 
const mutations={
    changeCate(state,res){
        state.cateList=res
    }
}
const actions={
    cateActions(context){
        getCates().then(res=>{
            if(res.code===200){
                context.commit("changeCate",res.list);
            }
        })
    }
}
const getters={
    cate(state){
        return state.cateList;
    }
}
export default {
    state,
    mutations,
    actions,
    getters,
    namespaced:true
}